#include <QApplication>
#include <QLabel>
#include <QImage>
#include <QFile>
#include <iostream>

using namespace std;
int main (int argc, char *argv[])
{
  QApplication app(argc, argv);
  QLabel *label = new QLabel("Hello Qt!");
  label->show();

  QImage image("google.png");
  QFile file("myfile.dat");
  if(!file.open(QIODevice::WriteOnly))
    {
      cerr <<"cannot open file for writing:"
	   << qPrintable(file.errorString()) << endl;
      return 0;
    }
  QDataStream out(&file);
  out.setVersion(QDataStream::Qt_4_1);
  out << image;
  file.close();


  file.open(QIODevice::ReadOnly);
  QDataStream in(&file);
  in.setVersion(QDataStream::Qt_4_1);
  
   
  return app.exec();
}
